Conditions | 1 |
Paths | 1 |
Total Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | module.exports = function (gulp, plugins, config) { |
||
|
|||
2 | return function htmlmin() { |
||
3 | const fs = require('fs'); |
||
4 | |||
5 | return gulp.src('build/*.html') |
||
6 | .pipe(plugins.inject(gulp.src(['config.json']), { |
||
7 | starttag: '<!-- inject:config -->', |
||
8 | transform: function (filePath, file) { |
||
9 | return '<script>var jsonData =' + |
||
10 | file.contents.toString('utf8') |
||
11 | .replace('<!-- inject:cache-breaker -->', |
||
12 | Math.random().toString(12).substring(7)) + |
||
13 | ';</script>' |
||
14 | ; |
||
15 | } |
||
16 | })) |
||
17 | .pipe(plugins.kyhInlineSource({ compress: false })) |
||
18 | .pipe(plugins.cacheBust({ |
||
19 | type: 'timestamp' |
||
20 | })) |
||
21 | .pipe(plugins.htmlmin({ |
||
22 | removeComments: true, |
||
23 | collapseWhitespace: true, |
||
24 | minifyJS: true |
||
25 | })) |
||
26 | .pipe(gulp.dest('build')); |
||
27 | }; |
||
28 | }; |
||
29 |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.